package com.neuedu.springmvc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

@Controller
public class TestController {
    //--访问test方法:    http://localhost:8080/springmvc/test
    @RequestMapping("/test")
    public void test(HttpServletRequest request, HttpServletResponse response) throws IOException {
        System.out.println("后台Controller执行");

        PrintWriter out = response.getWriter();
        out.write("success");
        out.flush();
        out.close();
    }
}
